
The Cabbage Compiler
====================

From the website:

  Dr. Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat Yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th
  http://fivedots.coe.psu.ac.th/~ad/cabbage


If you use this code, please mention my name, and include a link
to the website.

Thanks,
  Andrew

==================================================

This directory contains the source code for the Cabbage compiler.

Java files:
  Cabbage.java      // the top-level of the compiler 
  CodeGen.java     
  CodeLine.java    
  CodeOps.java
  Lexer.java       
  LexerTest.java    // a test rig for checking the lexer
  Parser.java      
  ParserTest.java  // a test rig for checking the BNF 
                      without any code generation
  Token.java       
  Toks.java        
  VarInfo.java

JFlex file:
  Lexer.jflex     // translated by jflex into Lexer.java


Batch file for compiling:
  * compile.bat

----------------------------
Before Compilation:

You need to download and install:
  * JFlex: http://jflex.de/

     - the compile.bat batch file assumes that you have 
       downloaded JFlex 1.6.1, unzipped and saved it as 
       the folder D:\dflex-1.6.1
         

----------------------------
Compiling the code:

> compile.bat

     - make sure the first java call inside the Batch file
       refers to the correct location for the JFlex JAR;

     - 1) the JFlex file, Lexer.jflex, is translated to Java; 
     - 2) all the Java files are compiled;
     - 3) a JAR file called cabbage.jar is created;
     - 4) the cabbage.jar file is copied to the parent directory


-----------------------------
Last updated: 15th March 2018
